
<template>
  <div class="org s-singlePage">
    <orgTree @getSelectNode="getSelectNode" ref="orgTree" @afterAdd="afterAdd"></orgTree>
    <orgList ref="orgList" @handlerDelete="handlerDelete(row)" ></orgList>
  </div>
</template>

<script>
import orgTree from "./module/orgTree";
import orgList from "./module/orgList";
export default {
  name: "org",
  components:{
    orgList,
    orgTree
  },
  methods:{
    getSelectNode(node){
      this.$refs.orgList.tableData = node.childOrgTreeVOS
      this.$refs.orgList.parentNode = node
    },
    afterAdd(node){
      this.$refs.orgList.parentNode.childOrgTreeVOS.push(node)
    },
    handlerDelete(){
      this.$refs.orgTree.$refs.commonOrgTree.getOrgTree();
    },
  }

}
</script>

<style scoped lang="less">
.org{
  display: flex;
}
</style>